package com.woniu.darryringmall.utils;

import java.util.Map;

/**
 * 统一返回的JSON数据，包含状态码，消息，和数据
 * @param <T> 泛型可以是任意数据类型
 */
public class ResponseData<T> {
    private int code;
    private int stateCode;
    private String msg;
    private T data;

    public ResponseData() {}

    public ResponseData(int stateCode, String msg) {
        this.stateCode = stateCode;
        this.msg = msg;
    }
    public ResponseData(T data){
        this(ResultStateCode.SUCCESS, "ok");
           this.data=data;
    }

    public ResponseData(int stateCode, String msg,T data) {
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getStateCode() {
        return stateCode;
    }

    public void setStateCode(int stateCode) {
        this.stateCode = stateCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
